<!--
Author: Quan Van Sinh
Email : sinhvnb@vietnambiz.com
Mobile: 0972405165
-->
<?php include ADMIN_INCLUDE_DIR."/header.php";?>
<script language="javascript" type="text/javascript">
    function createRandomNumber(varLength) {
        var sourceArr = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9");
        var randomKey;
        var randomCode = "qvsinh_";
        for (i=0; i<varLength; i++) {
            randomKey = Math.floor(Math.random()*sourceArr.length);
            randomCode = randomCode + sourceArr[randomKey];
        }
        return randomCode;
    }

    function delThisUploadFile(htmlId){
        $("#"+htmlId).remove();
    }
    function addFileUpload(){
        var liId = createRandomNumber(8);
        var htmlFileUpload = '<div id="'+liId+'" class="column_dt3_r"><input type="file" name="docs[]" size="30" style="float:left;" /><a style="margin: 5px 0 5px 15px; float: left;" href="javascript:delThisUploadFile(\''+liId+'\');">Xóa</a></div>';
        $("#fileUploadContainer").append(htmlFileUpload);
    }

    function removeImage(id,imageId){
        $("#removeFile").append('<input type="hidden" name="removeFiles[]" value="'+imageId+'"/>');
        $("#"+id).remove();
    }

    function submitFormAddNews(submitType){
        if(submitType=='exit'){
            $("#submitType").val('exit');
            $("#submitFrmNewsAdd").click();
        }
    }
</script>
<div class="container_l">
    <form name="formNewsAddCategory" method="POST" action="" enctype="multipart/form-data">
        <div class="title_user"><img src="images/icon1.gif" />Đối tác</div>
        <div class="table_user">
            <div class="table_user_in2">
                <?php
                show_error();
                show_success();
                ?>
                <fieldset>
                    <legend accesskey="N">Đối tác</legend>
                    <div class="lineaddnew">
                        <div style="width:70%;float:left;">

                            <div style="display:none;" id="removeFile"></div>
                            <div class="lineform">
                                <div class="divlabel_news">Tiêu đề: <font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <input type="text" name="title" value="" />
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">link: <font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <input type="text" name="link" value="http://" />
                                </div>
                            </div>                           
                            <div class="lineform">
                                <div class="divlabel_news">File: <font color="#FF0000">*</font></div>
                                <div class="divform" id="fileUploadContainer">
                                    <input type="file" name="file" />
                                </div>
                            </div>
                            
                            <div class="lineform">
                                <div class="divlabel_news">Chi tiết: </div>
                                <div class="divform">
                                    <textarea name="description" rows="4" cols="20"></textarea>
                                </div>
                            </div>
                            
                            <div class="lineform">
                                <div class="divlabel_news">Trạng thái: <font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <select name="status" style="width:72%;">
                                        <option value="yes">Cho phép hiển thị</option>
                                        <option value="no">Không hiển thị</option>
                                    </select>
                                </div>
                            </div>
                            

                        </div>
                    </div>
                    <div class="spacer1"><span></span></div>
                </fieldset>
                <div class="linesubmit">
                    <input type="hidden" name="submitType" id="submitType" value="">
                    <input type="submit" name="submitFrmNewsAdd" id="submitFrmNewsAdd" value="Lưu lại" class="button" />
                    <input type="button" name="submitFrmNewsAddAndExit" onclick="document.location='?module=partner';" value="Submit & Exit" class="button" />
                </div>
            </div>
        </div>
    </form>
</div>
<?php
include "inc/right.php";
include ADMIN_INCLUDE_DIR."/footer.php";
?>